
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    {include file="public/_head"}
    <title>添加用户 - H-ui.admin v3.0</title>
</head>
<body>
<article class="cl pd-20">
    <form action="" method="post" class="form form-horizontal" id="form-member-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户状态：</label>
            <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                <div class="radio-box">
                    <input name="status" type="radio" id="sex-1" value="1" {$data.status == '启用'?'checked':''} {$data.status == ''?'checked':''}>
                    <label for="sex-1">启用</label>
                </div>
                <div class="radio-box">
                    <input type="radio" id="sex-2" name="status" value="2" {$data.status == '禁用'?'checked':''}>
                    <label for="sex-2">禁用</label>
                </div>
            </div>
        </div>
        <input type="hidden" id="user_id" value="{$data.id|default=''}">
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="button" onclick="submit1()"
                       value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>

<!--_footer 作为公共模版分离出去-->
{include file="public/_footer" /}
<!--/_footer /作为公共模版分离出去-->

<script type="text/javascript">
    function submit1() {
        let status = $('input[name^="status"]:checked').val();
        let data = {
            id: $("#user_id").val(),
            status: status
        };
        $.ajax1(this, '/user/save', 'post', data, function () {
            $.mag('添加成功', 1, 3000);
            parent.location.href = "/user/index";
        });
    }
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>